#include<stdio.h>
int strlen(char *a){
    int i=0;
    int length=0;
    while(a[i]!='\n'){
        i++;
        length++;
    }
    return length;
}
void count(char * str, int * upper, int *lower, int *space, int *num, int*other){
    int i=0;
    while(str[i]!='\0'){
        if(str[i]>='A'&&str[i]<='Z'){
            (*upper)++;
        }
        else if(str[i]>='a'&&str[i]<='z'){
            (*lower)++;
        }
        else if(str[i]>='0'&&str[i]<='9'){
            (*num)++;
        }
         else if(str[i]==' '){
           ( *space)++;
        }
         else (*other)++;
         i++;
    }
}
int main(){
    char a[270];
    fgets(a,sizeof(a),stdin);
    int up=0;
    int lo=0;
    int sp=0;
    int num=0;
    int ot=0;
    count(a,&up,&lo,&sp,&num,&ot);
    printf("%d %d %d %d %d",up,lo,sp,num,ot);
    return 0;
}